package cn.iutils.faq.service;

import cn.iutils.common.service.CrudService;
import cn.iutils.faq.dao.AnswersDao;
import cn.iutils.faq.entity.Answers;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
* 回答表 Service层
* @author iutils.cn
* @version 1.0
*/
@Service
@Transactional(readOnly = true)
public class AnswersService extends CrudService<AnswersDao, Answers> {

    /**
     * 根据问题编号清空回答
     * @param questionId
     * @return
     */
    @Transactional(readOnly = false)
    public int deleteByQuestionId(String questionId){
        return dao.deleteByQuestionId(questionId);
    }

    /**
     * 获取活跃用户列表
     * @param size
     * @return
     */
    public List<Map> findHotList(int size){
        return dao.findHotList(size);
    }

}
